import React, { Component } from "react";
import axios from "axios";
import form from "./index.module.css";
export default class Form extends Component {
  submit = (e) => {
    e.preventDefault();
    console.log(this.username.value);
    console.log(this.password.value);
     axios.get("http://localhost:5000/captcha").then((res) => console.log(res));
  };
  render() {
    return (
      <form className={form.form} action="/login">
        <label>
          账号: <input type="text" ref={(e) => (this.username = e)} />
        </label>
        <label>
          密码: <input type="password" ref={(e) => (this.password = e)} />
        </label>
        <button type="submit" onClick={this.submit}>
          登录
        </button>
      </form>
    );
  }
}
